#include "main.h"
#include <stdio.h>

TP_meter::TP_meter(QWidget *parent,bool psu) :
    QWidget(parent),
    ui(new Ui::TP_meter),pressure_display(psu)
{
    ui->setupUi(this);
    if( pressure_display )
    {
         ui->label->setText(tr("内室压力"));
         ui->label_2->setText(tr("kPa"));
    }
    QTimer* timer = new QTimer();
    QObject::  connect( timer, SIGNAL(timeout()), this, SLOT(timerDone()) );
    timer->start( 500 );
}

TP_meter::~TP_meter()
{
    delete ui;
}
void TP_meter::timerDone()
{
    if(pressure_display)  ui->lcdNumber->display(PSU);
    else {sprintf(ch_TEM,"%.1f",TEM);ui->lcdNumber->display(ch_TEM);}
}
 void TP_meter:: setpressure_display()
 {
      pressure_display=1;
     ui->label->setText(trUtf8("内室压力"));
     ui->label_2->setText("kPa");
 }
